import React from 'react';
import Container from '../components/Base/Container';
import { connect } from 'dva';
import { Tabs, WhiteSpace, SearchBar, WingBlank, Badge, Accordion } from 'antd-mobile';
import styles from './KnowledgeInfo.less';

class ShopWeeklyInfo extends React.Component{

  render(){
    let {shopWeeklyContent}=this.props.knowledge;
    return(
      <Container title="商品库">
        <div className={styles.top}>
          <div className={styles.title}>
            <img src={require('../assets/shopWeeklyBaby.png')} alt=""/>
            <span className={styles.h2}>{shopWeeklyContent.h2}</span>
          </div>
        </div>

        <Accordion defaultActiveKey='0' openAnimation={{}} className={styles.accordion}  >

          {
            shopWeeklyContent.section&&
            shopWeeklyContent.section.map((item,index)=>{
                return (
                  <Accordion.Panel key={index} header={<div className={styles.header}><img src={require('../assets/weeklyQuestion.png')} className={styles.img2} alt=""/><span>{item.question}</span></div>}>

                    {
                      item.answer&&
                      item.answer.map((item, index)=>(
                        <div key={index} className={styles.select}>{item.trim()}</div>
                      ))
                    }
                  </Accordion.Panel>
                )
            })
          }

        </Accordion>

      </Container>
    )
  }
}

export default connect(({knowledge})=>({knowledge}))(ShopWeeklyInfo);
